import{ Component, OnInit} from "@angular/core";
import{ MistakeService } from "./mistake.service";
import{ Mistake } from "./mistake";

@Component({
    selector:'pages-mistake',
    templateUrl:'mistake.html',
    providers:[MistakeService],
})

export class MistakeComponent implements OnInit{
    mistakes:Mistake[];
    constructor(private mistakeService:MistakeService){
        this.mistakes = [];
    }

    ngOnInit():void{
        this.getMisQuestion();
    }

    getMisQuestion(){
        this.mistakeService.getMistake().then(data=>this.mistakes = data,
        error=>console.log(error));
    }
}